from sentence_transformers import SentenceTransformer
#下载模型 huggingface-cli download --resume-download --local-dir-use-symlinks False sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 --local-dir E:\repository\model\paraphrase-multilingual-MiniLM-L12-v2

# 指定本地模型路径
model_path = r'E:\repository\models\paraphrase-multilingual-MiniLM-L12-v2'  # 替换为你的本地路径

# 加载本地模型
model = SentenceTransformer(model_path)

# 示例句子
sentences = ["This is an example sentence", "Each sentence is converted"]

# 生成嵌入向量
embeddings = model.encode(sentences)

# 打印嵌入向量
print(embeddings)